using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace TurbaconPhone
{
    class Power : ParticleEmitter
    {
        float Size;

        public Power(string textureName, float lifeTime, GameObject owner, float size)
            : base(textureName, owner.Pos, Vector2.Zero, lifeTime, 0.09f, 1)
        {
            Attach(owner);
            Size = size;
        }

        protected override void CreateParticle()
        {
            float angle = (float)TurBacon.RandomBetween(-MathHelper.Pi, MathHelper.Pi);
            Vector2 v = new Vector2(
                (float)Math.Cos(angle) * TurBacon.RandomBetween(1f, 1.7f),
                (float)Math.Sin(angle) * TurBacon.RandomBetween(1f, 1.7f));
            float life = TurBacon.RandomBetween(1.3f, 1.6f);
            float aV = TurBacon.RandomBetween(-MathHelper.PiOver4 / 8, MathHelper.PiOver4 / 8);


            Particle exp = new Particle(Texture, Pos + new Vector2(0,-30), v, life);
            //exp.Accelerating(v / life);
            exp.Rotating(angle, aV);
            exp.Resizing(Size * 0.05f, 1.015f);

            exp.FadeIO = true;
        }
    }
}
